// 头部

import styled from 'styled-components';
import logoImg from '../../assets/logo.png';

const fontColor = '#969696';
const littleRadius = '3px';

export const HeaderWrapper = styled.div`
  height: 56px;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
`;

export const SearchInfo = styled.div`
    position: absolute;
    left: 0;
    top: 66px;
    width: 240px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 10px;
    box-shadow: 0 0 8px rgba(0,0,0,.2);
    background: #fff;
    .title{
        margin-top: 20px;
        margin-bottom: 15px;
        line-height: 20px;
        font-size: 14px;
         color: ${fontColor};
    }
    .switch{
        float:right;
        font-size: 13px;
        display:flex;
        align-items: center;
        span {
          margin-left: 6px;
        }
    }
    .triangle{
         width:0;
         height:0;
         border-left:6px solid transparent;
         border-right:6px solid transparent;
         border-bottom:12px solid #fff;
         position: absolute;
        left: 30px;
        top: -12px;
    }
    ul{
       display:flex;
       flex-wrap: wrap;
       a{
         margin-bottom: 10px;
         margin-right: 10px;
       } 
    }
`;
export const SearchInfoItem = styled.a.attrs({
    href: '/'
})`         
          display: block;
          line-height: 20px;
          padding: 0 5px;
          font-size: 12px;
          border:1px solid #ddd;
          color: ${fontColor};
          border-radius: ${littleRadius};
`;

// 元素的属性可以使用attrs方法，传入一个对象设置属性
export const Logo = styled.a.attrs({
    href: '/'
})`
  width: 100px;
  height:56px;
  background-image:url(${logoImg});
  background-size:contain;
  float: left;
`;

export const Nav = styled.div`
  height: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding-right: 70px;
  box-sizing: border-box;
`;

export const NavItem = styled.div`
    line-height: 56px;
    padding: 0 15px;
    font-size: 17px;
    box-sizing: border-box;
    &.left {
        float: left;
    }
    &.right {
        float: right;
    }
    &.active {
        color:#ea6f5a;
    }
`;

export const NavSearch = styled.input.attrs({
    placeholder: '搜索'
})`
    width: 160px;
    height: 38px;
    border: none;
    outline: none;
    border-radius: 16px;
    margin-left: 20px;
    margin-top: 9px;
    padding: 0 35px 0 20px;
    background: #eee;
    font-size: 14px;
    color: #777;
    &::placeholder {
        color: #999
    }
`;

export const Addition = styled.div`
    position: absolute;
    right:0;
    top: 0;
    height: 56px;
    .proButton{
        margin-top: 12px;
        border-radius: 19px;
        margin-right: 30px;
    }
    .register {
     border: 1px solid #ec6149;
     color: #ec6149;
    }
    .write {
        color: #fff;
        background: #ec6149;
        border: 1px solid #ec6149;
        margin-right: 50px;
    }
`;

export const SearchWrapper = styled.div`
    float: left;
    position: relative;
    // 动画
    .slide-enter{
      
        transition: all .2s ease-out;
    }
    .slide-enter-active{
        width: 240px;
    }
    .slide-exit{
      
        transition: all .2s ease-out;
    }
    .slide-exit-active{
        width: 160;
    }
    .isFocused{
        width: 230px;
    }
    .zoom{
        position: absolute;
        right:5px;
        bottom:4px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .iconBg{
        background: #777;
    }
`;


